package com.hzw.saas.service.rss.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzw.saas.service.rss.model.JournalUserAction;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 期刊相关的用户记录 Mapper 接口
 * </p>
 *
 * @author sonam
 * @since 2021-06-30
 */
@Mapper
public interface JournalUserActionMapper extends BaseMapper<JournalUserAction> {
    @Delete("<script> delete from tb_journal_user_action where user_id = #{userId}</script>")
    void deleteByUserId(@Param("userId") String userId);

    @Delete("<script> delete from tb_journal_user_action where catalog_id in <foreach item=\"pid\" collection=\"pids\"  open=\"(\" separator=\",\" close=\")\"> #{pid} </foreach> </script>")
    int deleteByCatalogIdsFromSql(@Param("pids") List<String> pids);

}
